<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<!DOCTYPE html>
<html lang="zh">
<head>
    <title>提问情况列表</title>

    <%@include file="/WEB-INF/views/commons/common.jsp" %>
    <link rel="stylesheet" type="text/css" href="${base_href}/static/ui-frame/bootstrap/3.3.5/css/bootstrap.min.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/jquery-easyui/1.4.3/themes/metro/easyui.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/bootstrap-dialog3/css/bootstrap-dialog.css">
    <link rel="stylesheet" type="text/css"
          href="${base_href}/static/ui-frame/validation-engine/validationEngine.jquery.css">
    <link rel="stylesheet" type="text/css" href="${base_href}/static/css/search-theme.css">

</head>
<body data-grid="easyui">
<div class="path"><span class="right-index">&gt;</span> 现在的位置：提问情况列表</div>
<div class="tab-content">
    <div class="fold_ex">
        <h2 class="title-h2">
			<span style="width:100%;">
				<button type="button" class="btn search-btn" data-method="addBtn"><i class="fa fa-plus"></i>&nbsp;提交错题&nbsp;</button>
			</span>
            <a href="javascript:void(0);" class="hide-next-btn">收起</a>
        </h2>

        <div>
            <form action="#">
                <table class="search-table container">
                    <tr>
                        <td class="text-right col-xs-2">书本名称</td>
                        <td class="col-xs-4">
                            <select name="bookClass" class="form-control">
                                <option value="" selected="selected">请选择</option>
                                <c:forEach items="${bookClasses}" var="state">
                                    <option value="${state.dicCode}">${state.dicValue}</option>
                                </c:forEach>
                            </select>
                        </td>
                        <td class="text-right col-xs-2">科目名称</td>
                        <td class="col-xs-4">
                            <select name="bookSubject" class="form-control">
                                <option value="" selected="selected">请选择</option>
                            </select>
                        </td>
                    </tr>
                    <tr>
                        <td class="text-right col-xs-2">问题序号</td>
                        <td class="col-xs-4">
                            <input type="text" class="form-control" name="quesCode" value=""
                                   placeholder="请填写数字，支持模糊查询"/>
                        </td>
                        <td class="text-right col-xs-2"></td>
                        <td class="col-xs-4">
                        </td>
                    </tr>

                    <tr>
                        <td class="text-right col-xs-2"></td>
                        <td class="text-right">
                            <button type="button" class="btn search-btn" data-method="search"><i
                                    class="fa fa-search"></i>&nbsp;查询&nbsp;
                            </button>
                            <button type="button" class="btn search-btn" data-method="clear"><i class="fa fa-trash"></i>&nbsp;清空&nbsp;
                            </button>
                        </td>
                    </tr>
                </table>
            </form>
        </div>

        <hr class="search-line"/>
        <table class="easyui-datagrid">
            <thead>
            <tr>
                <th data-options="field:'id',checkbox:true">选择</th>
                <th data-options="field:'bookName',width:100,align:'center'">书本名称</th>
                <th data-options="field:'subjectName',width:50,align:'center'">科目名称</th>
                <th data-options="field:'quesCode',width:50,align:'center'">问题序号</th>
                <th data-options="field:'createTime',width:50,align:'center'">提出时间</th>
            </tr>
            </thead>
        </table>
    </div>
</div>

<script type="text/javascript" src="${base_href}/static/ui-frame/jquery/1.11.3/jquery.js"></script>


<script type="text/javascript" src="${base_href}/static/ui-frame/iframe-auto-height/jquery.autoheight.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap/3.3.5/js/bootstrap.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/bootstrap-dialog3/js/bootstrap-dialog.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/jquery-easyui/1.4.3/jquery.easyui.min.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/jquery-easyui/1.4.3/easyui.util.js"></script>
<script type="text/javascript"
        src="${base_href}/static/ui-frame/validation-engine/jquery.validationEngine-zh_CN.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/validation-engine/jquery.validationEngine.js"></script>
<script type="text/javascript" src="${base_href}/static/ui-frame/My97DatePicker/WdatePicker.js"></script>

<script type="text/javascript" src="${base_href}/static/ui-frame/requirejs/2.2.0/require.js"></script>

<script type="text/javascript">
    requirejs.config({
        baseUrl: '<c:url value="/static/"/>',
        paths: {
            Grid: 'component/grid/js/ms-grid',
        },
        config: {
            'Grid': {contextPath: '<c:url value="/"/>'},
        }
    });

    require(['Grid'], function (Grid) {
        Grid.columns({
// 		quesCode: {
// 			formatter: function(value, row, index) {
// 				var v = value == null ? "" : $('<div/>').text(value).html();
// 				return "<a href='javaScript:void(0);' onclick=\"grid.paperName(event, " + index + ")\" class='grid-button' plain='true' title='"+ v +"'><div>" +  v + "</div></a>";
// 			},
// 			event: function(event, index) {
// 				var row = this.grid.datagrid('getRows')[index];
// 				var param = {resultId: row.paperResultId};

// 				var url = basePath + "/judgePaper/openAndJumpPaperPage.html?" + $.param(param);
// 				var screenLocation = "width=800px,height=700px,top=0,left=0,menubar=yes,resizable=yes,scrollbars =yes";
// 				this.windowOpen(url, "详细信息",screenLocation);
// 				event.stopPropagation();
// 			}
// 		}
        });
        Grid.methods({
            addBtn: function () {
                var url = basePath + "/studentQuestion/createPage.html";
                var screenLocation = "width=800px,height=700px,top=0,left=0,menubar=yes,resizable=yes,scrollbars =yes";
                this.windowOpen(url, "详细信息", screenLocation);
            }
        });
        $(function () {
            window.grid = Grid.events();

            $("select[name='bookClass']").change(function () {
                var bookClass = $(this).val();
                $("select[name='bookSubject'] option").remove();
                $("select[name='bookSubject']").append('<option value="" selected="selected">请选择</option>');
                if (bookClass != '') {
                    var url = basePath + "/dictionay/getChildrenByModelAndCode.json";
                    $.ajax({
                        url: url,
                        type: "get",
                        data: {"code": bookClass, "model": "book_class"},
                        dataType: "json",
                        success: function (data) {
                            for (var i = 0; i < data.length; i++) {
                                var option = '<option value="' + data[i].dicCode + '">' + data[i].dicValue + '</option>';
                                $("select[name='bookSubject']").append(option);
                            }
                        }
                    });
                }
            });
        })
    })
</script>

</body>
</html>
